home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.0
/
Video Toaster v4.0.iso
/
arexx
/
modeler
/
shapetext.lwm
< prev
next >
Wrap
Text File
|
1993-12-13
|
2KB
|
97 lines
/* CMD: Shape Text
* Extrude/Bevel text or other flat objects...
* By Arnie Cachelin © 1992, 1993 NewTek Inc. */
styles = 'Block Chisel Round'
typ=1
deep = 0.1
wide = 0.02
call addlib "rexxsupport.library", 0, -30, 0
libadd = addlib("LWModelerARexx.port",0)
signal on error
signal on syntax
MATHLIB="rexxmathlib.library"
IF POS(MATHLIB , SHOW('L')) = 0 THEN
IF ~ADDLIB(MATHLIB , 0 , -30 , 0) THEN DO
call notify(1,"!Can't find "MATHLIB)
exit
END
call req_begin 'Shape Text'
id_typ = req_addcontrol("Text Type", "CH",Styles)
id_deep = req_addcontrol("Depth", 'n', 1)
id_wide = req_addcontrol("Edge Width", 'n', 1)
axid = req_addcontrol("Axis", "CH",'X Y Z')
call req_setval id_typ, typ,1
call req_setval id_deep, deep,0.1
call req_setval id_wide, wide,0.02
call req_setval axId, 3
if (~req_post()) then do
call req_end
exit
end
typ = req_getval(id_typ)
wide = req_getval(id_wide)
deep = req_getval(id_deep)
axis = translate(req_getval(axId),'XYZ','123')
call req_end
call ShapeText(typ)
if (libadd) then call remlib("LWModelerARexx.port")
exit
syntax:
error:
call end_all
t=Notify(1,'!Rexx Script Error','@'ErrorText(rc),'Line 'SIGL)
if (libadd) then call remlib("LWModelerARexx.port")
exit
Bevel_Block:
call bevel(0, deep / 2)
return
Bevel_Chisel:
call shapebevel(-wide wide (-wide) deep/2)
return
Bevel_Round:
n = 5
pat = ''
do i=1 to n
a = 3.14159/2 * i / n
pat = pat (-sin(a)*wide) (1-cos(a))*wide
end i
call shapebevel(pat (-wide) deep/2)
return
ShapeText: PROCEDURE expose wide styles deep axis
arg typ
sl1 = curlayer()
empty = emptylayers()
if (words(empty) < 1) then do
call notify 1,syscode,"!Need an empty layer","!for this operation."
exit
end
sl2 = word(empty, 1)
call copy
sbase=cursurface()
call setlayer sl2
call paste
call sel_mode('user')
call sel_polygon('set')
interpret 'call Bevel_' || word(styles, typ)
call cut
call changesurface(sbase || "_Side")
call setlayer sl1 /* Get the correct faces from sl1. */
call changesurface(sbase)
call flip
call cut
call setlayer sl2
call paste
call mirror(axis, -deep/2)
call mergepoints
call cut
call setlayer sl1
call paste
return